home *** CD-ROM | disk | FTP | other *** search
/ Adventures with Oslo: Tools & Gadgets / Adventures with Oslo - Tools and Gadgets.ISO / mac / Studio / ReadPix.Dir / 00041.ls < prev    next >
Encoding:
Text File  |  1994-09-23  |  2.3 KB  |  77 lines

  1. on startMovie
  2.   global pictNum, maxPicts
  3.   if (the memorysize / 1024) < 3520 then
  4.     set the visible of sprite 11 to 0
  5.     set the visible of sprite 12 to 0
  6.     set the visible of sprite 13 to 0
  7.     set the visible of sprite 14 to 0
  8.     set maxPicts to 8
  9.   else
  10.     set maxPicts to 12
  11.   end if
  12.   set HC to the number of cast "handCursor"
  13.   cursor([HC, HC + 1])
  14.   set pictNum to the number of cast "pict1"
  15. end
  16.  
  17. on readPicts fileNum, order
  18.   global pictFolder, skObj, maxPicts
  19.   set pict to 1
  20.   repeat while pict <= maxPicts
  21.     set fileName to getNthFileNameInFolder(pictFolder, fileNum)
  22.     if fileName = EMPTY then
  23.       repeat with i = pict to maxPicts
  24.         set the picture of cast ("pict" & i) to the picture of cast "blank"
  25.         put EMPTY into line i of field "pictFiles"
  26.       end repeat
  27.       set pict to maxPicts + 1
  28.     else
  29.       if fileName starts "pict" then
  30.         if the machineType = 256 then
  31.           set result to skObj(mFileToCast, pictFolder & fileName)
  32.         else
  33.           set temp to FileIO(mnew, "read", pictFolder & fileName)
  34.           if objectp(temp) then
  35.             set result to temp(mReadPICT)
  36.           else
  37.             set result to 0
  38.           end if
  39.         end if
  40.         if value(result) = 0 then
  41.           alert("Error " & result & " reading from File: " & fileName)
  42.           set the picture of cast ("pict" & pict) to the picture of cast "blank"
  43.           put EMPTY into line pict of field "pictFiles"
  44.         else
  45.           set offset to (pict - 1) mod 4
  46.           puppetSound(the name of cast (the number of cast "marimba1" + offset))
  47.           updateStage()
  48.           set the picture of cast ("pict" & pict) to result
  49.           put fileName into line pict of field "pictFiles"
  50.         end if
  51.         if objectp(temp) then
  52.           temp(mdispose)
  53.         end if
  54.         set pict to pict + 1
  55.       end if
  56.     end if
  57.     if order = #ascending then
  58.       set fileNum to fileNum + 1
  59.       next repeat
  60.     end if
  61.     if order = #descending then
  62.       set fileNum to fileNum - 1
  63.     end if
  64.   end repeat
  65.   return fileNum
  66. end
  67.  
  68. on selectPict
  69.   global pictNum
  70.   puppetSprite(2, 1)
  71.   puppetSound("Piano Chord C Major")
  72.   set the locH of sprite 2 to the locH of sprite the clickOn
  73.   set the locV of sprite 2 to the locV of sprite the clickOn
  74.   set pictNum to the castNum of sprite the clickOn
  75.   updateStage()
  76. end
  77.